import { MoneyDefine } from "../../../../../defines/money_define";
import { Task } from "../../../../task";

export default class TaskNode extends Task{
  constructor(root){
    super(root);

    this.num = 10;
  }

  getTitle(){
    return '采集止血草';
  }

  getDesc(){
    return '村庄的止血草已经不够用了，帮助村长去周边的森林中采集止血草。'
  }

  getTip(){
    let flag = this.getIsComplete();
    let num = this.root.backdrop.findKeyGoodNum('植物/凡草/止血草');

    return flag ? `与村长提交任务吧` : `当前进度: ${num}/${this.num}株`;
  }

  getIsComplete(){
    let num = this.root.backdrop.findKeyGoodNum('植物/凡草/止血草');

    return num >= this.num;
  }

  completedCb(npc){
    this.root.backdrop.findGoodKeyCousume('植物/凡草/止血草', this.num);
    this.root.backdrop.playerGetMoney(MoneyDefine.money.key, 500);
  }
}